<template>
	<view class="seeEmail" :class="APPTheme">
		<uni-nav-bar fixed status-bar left-icon="back" title="音频详情" :color="APPTheme=='theme-light'?'#000000':'#ffffff'" :background-color="APPTheme=='theme-light'?'#ffffff':'#000000'" @clickLeft="clickLeftback"></uni-nav-bar>
		<view class="center">
			<imt-audio ref="lzAudio" :src="current.src" autoplay :duration="current.duration"></imt-audio>
		</view>

	</view>
</template>

<script>
	let that
	import {
		mapGetters,
		mapActions
	} from 'vuex'
	export default {
		components: {},
		data() {
			return {
				current: {
					poster: '',
					name: '致爱丽丝',
					author: '暂无',
					src: '',
					duration:10,
				},
				audioAction: {
					method: 'pause'
				}
			}
		},
		computed: {
			...mapGetters(['APPTheme', 'userInfo', 'api']),
		},
		
		onLoad(e) {
			that = this
			console.log(e);
			that.current.src = e.url
			that.current.duration = parseInt(e.time)
		},
		onShow() {
			//设置主题颜色
			that.GLOBAL.setThemeColor(that.APPTheme)
		},
		onUnload(){
			that.$refs.lzAudio.closeAudio()
		},
		methods: {
			//返回
			clickLeftback() {
				uni.navigateBack({
					delta: 1
				});
			},
		}
	};
</script>

<style scoped lang="scss">
	.seeEmail {
		width: 100%;
		height: 100%;

		.center {}

	}
</style>
